<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">
		var arr =[];
		//随机7个不重复的数
		for (var i = 0; i < 7; i++) {
			num = Math.round((Math.random()*(49-1))+1);
			if(arr.indexOf(num)=='-1'){
				arr.push(num);
			}else{
				i--;
			}
		}
		// document.write(arr);
		//随机取一个人
		arr =['小明','小红','小花','小花','小花','小花','小花','小花','小花','小花','小花','小李','小王'];

		num = Math.round(Math.random()*(arr.length-1));

		// document.write(arr[num]);
		// 计算元旦到现在还有几天几小时几分几秒
		var yudan = new Date('2019-01-01 0:0:0');
		var now  = new Date();
		var diffTime = (yudan.getTime()-now.getTime())/1000;

		var day = Math.floor((diffTime/86400));
		var hours = Math.floor((diffTime%86400)/3600);
		var min = Math.floor(((diffTime%86400)%3600)/60);
		var second = Math.floor(((diffTime%86400)%3600)%60);

		// document.write(day+"天"+hours+"小时"+min+"分钟"+second+"秒");

		//求生日里面有几个周日
		cn = 0;
		for (var i = 1990; i <= 2018; i++) {
			
			obj = new Date(i+'-07-06');

			if(obj.getDay()==0){
				cn++;
			}
		}

		// document.write(cn);

		//元旦到现在过了几天
		yuandan = new Date('2018-01-01 0:0:0');

		now = new Date();


		day = Math.floor((now.getTime()-yuandan.getTime())/86400/1000)

		// document.write(day);

		//上个月的这一天是周几
		now  = new Date();

		year = now.getFullYear();

		date = now.getDate();

		month = now.getMonth();

		nextMonth = new Date(year,month-1,date);

		document.write(nextMonth.getDay());

		//100天后是几月几号
		now = new Date();

		nowTime = now.getTime()+100*86400*1000;

		yibai = new Date(nowTime);

		document.write(yibai);

	</script>
</head>
<body>
	
</body>
</html>